package com.ruoyi.wallet.domain;

import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.distributor.domain.DistributionUser;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 分销钱包对象 wdmd_distribution_wallet
 * 
 * @author ruoyi
 * @date 2025-10-11
 */
@Data
public class DistributionWallet extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 钱包ID */
    private Long walletId;

    /** 分销员ID */
    @Excel(name = "分销员ID")
    private Long distributorId;

    /** 可用余额 */
    @Excel(name = "可用余额")
    private BigDecimal availableBalance;

    /** 冻结余额 */
    @Excel(name = "冻结余额")
    private BigDecimal frozenBalance;

    /** 累计收入 */
    @Excel(name = "累计收入")
    private BigDecimal totalIncome;

    /** 累计提现 */
    @Excel(name = "累计提现")
    private BigDecimal totalWithdraw;

    /** 最后入账时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后入账时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastIncomeTime;

    /** 最后提现时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后提现时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastWithdrawTime;

    /** 状态：0-正常 1-冻结 */
    @Excel(name = "状态：0-正常 1-冻结")
    private String walletStatus;

    /** 状态（0=上架 1=下架） */
    @Excel(name = "状态", readConverterExp = "0==上架,1==下架")
    private String status;

    /** 删除标志（0存在 2删除） */
    private String delFlag;

    /** 版本号（乐观锁） */
    @Excel(name = "版本号", readConverterExp = "乐观锁")
    private Long version;

    /** 待结算余额 */
    @Excel(name = "待结算余额")
    private BigDecimal pendingSettlementBalance;


    /** 分销用户信息信息 */
//    private List<DistributionUser> distributionUserList;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("walletId", getWalletId())
            .append("distributorId", getDistributorId())
            .append("availableBalance", getAvailableBalance())
            .append("frozenBalance", getFrozenBalance())
            .append("totalIncome", getTotalIncome())
            .append("totalWithdraw", getTotalWithdraw())
            .append("lastIncomeTime", getLastIncomeTime())
            .append("lastWithdrawTime", getLastWithdrawTime())
            .append("walletStatus", getWalletStatus())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("version", getVersion())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("remark", getRemark())
            .append("pendingSettlementBalance", getPendingSettlementBalance())
            .toString();
    }
}
